<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/struts/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='script/prototype.js'></script>
<script type='text/javascript' src='script/common.js'></script>
<link href="./style/alternative.css" media="all" rel="stylesheet" />
<style type="text/css">
#moduleForm {
    padding-left:2em;
    padding-top:2em;
}
</style>
</head>
<body>
<c:choose>
<c:when test="${empty module}">
<c:set var="handler" value="module.htm?method=create" />
</c:when>
<c:otherwise>
<c:set var="handler" value="module.htm?method=update" />
</c:otherwise>
</c:choose>
<div id="content"><div id="content_inner">
<div id="module">
<form name="moduleForm" id="moduleForm" action="${handler}"  method="post">
<TABLE id="moduleTab" class="its">
<thead>
  <TR>
    <TH colspan="2" align="center">模  块 
<a href="module.htm?method=retrieve&moduleID=${module.moduleID}"
 title="${module.description}">
${module.moduleName}
</a></TH>
  </TR>
  </thead>
  <TR>
    <TD>模块名称:</TD>
    <TD>
    <TEXTAREA NAME="moduleName" id="moduleName" ROWS="1" COLS="60">${module.moduleName}</TEXTAREA>
    </TD>
  </TR>
  <TR>
    <TD>模块描述:</TD>
    <TD>
    <TEXTAREA NAME="description" id="description" ROWS="1" COLS="60">${module.description}</TEXTAREA>
    </TD>
  </TR>
  <TR>
    <TD>模块链接:</TD>
    <TD>
    <TEXTAREA NAME="moduleLink" id="moduleLink" ROWS="1" COLS="60">${module.moduleLink}</TEXTAREA>
    </TD>
  </TR>
  <TR>
    <TD>上级模块: </TD>
    <TD><select id="parentModuleID" name="parentModuleID">
<option value="0">无上级模块</<option>
<c:forEach items="${sess_user.role.moduleList}" var="aModule" varStatus="moduleNum">
<option value="${aModule.moduleID}">${aModule.description}</<option>
 </c:forEach></select>
</TD>
  </TR>
  <TR>
    <TD colspan="2" align="center">
    <input type="hidden" name="moduleID" id="moduleID" value="${module.moduleID}">
    <INPUT TYPE="submit" value="确认">&nbsp;&nbsp;
    <INPUT TYPE="reset" value="取消" onclick="javascript:history.back()"></TD>
  </TR>
  </TABLE>
</FORM>
</div><!-- module -->
</div><!-- content_inner -->
</div><!-- content -->

<script language="Javascript">
<c:if test="${not empty module}">
var pid = "" + "${module.parentModuleID}";
toSelect("parentModuleID",pid);

</c:if>
</script>
